package cn.wwcyc.controller;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;

public interface DF {

    void apply(String s);

    default DF andThen(DF after) {
        System.out.println("benhanshu this=" + this);
        return new DF() {
            public void apply(String t) {
                System.out.println("in niming apply this= " + this);
            }
        };
    }
    default DF andThen2(DF after) {
        System.out.println("benhanshu this=" + this);
        return s -> {System.out.println("in lambda apply this= " + this);};
    }

    public static void main(String[] args) {
        DF d = new DF() {
            @Override
            public void apply(String s) {
                System.out.println("d.apply");
            }
        };
        DF after = new DF() {
            @Override
            public void apply(String s) {
                System.out.println("after.apply");
            }
        };
        d.andThen(after).apply("");
        d.andThen2(after).apply("");
    }

}
